<?php

ini_set('default_socket_timeout',-1); //连接不超时
$redis=new \Redis();
//$redis->auth();
$redis->connect('127.0.0.1',6379);
$redis->auth('redis123456');
//订阅常驻内存
$redis->subscribe(['test'],function($redis, $chan, $msg){
      var_dump($chan, $msg);
});